const express = require('express')
const router = express.Router()
const {userHandler} = require('../router_handler/index')
const expressJoi = require('@escook/express-joi')
const {register,login,updateUserInfo,updatePassword} = require('../auth/user')

router.post('/login',expressJoi(login),userHandler.login)
router.post('/register',expressJoi(register), userHandler.register)
router.get('/getUserInfo', userHandler.getUserInfo)
router.get('/getUserList', userHandler.getUserList)
router.delete('/deleteUser/:id', userHandler.deleteUser)
router.put('/updateUserInfo',expressJoi(updateUserInfo), userHandler.updateUserInfo)
router.put('/updatePassword',expressJoi(updatePassword), userHandler.updatePassword)

module.exports = router